﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestWork2
{
    class TextInput
    {
        private string path = @"C:\Users\anton\Documents\C#\Inteducation\aisaiev\TestWork2\TestWork2\text.txt";


        public void WriteToFile()
        {
            string text = Console.ReadLine();
            File.WriteAllText(path, text);
        }

        public void WordCalculator()
        {
            string file = File.ReadAllText(path);
            string[] fileSplit = file.Split(' ');
            Console.WriteLine("Amount of words in text: {0}", fileSplit.Length);
        }
    }
}
